package com.yml.mybatis.gererator.service;

import com.yml.mybatis.gererator.meta.DataSourceInfo;

/**
 * @author YML
 * @since 2023-07-20 10:22
 */
public class TableFactory {

    public static ITableService getService(DataSourceInfo dataSource){
        switch (dataSource.getDbType()){
            case SQL_SERVER:
                return new SqlServerTable(dataSource);
            case MYSQL:
                return new MySqlTable(dataSource);
            default:
                throw new RuntimeException("暂不支持的数据库类型");
        }
    }

}
